home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0115_Loading FONT file.pas < prev    next >
Pascal/Delphi Source File  |  1994-08-24  |  2KB  |  58 lines

  1. {
  2. RN> Hi! Does anyone know if it's possible to modify the
  3. RN> characters in the ASCII chart using Pascal?  The reason I
  4. RN> want to do this is to define the upper ASCII characters
  5. RN> (128+) to implement the Cyrillic alphabet, for an
  6. RN> application I'm developping (or will be developping if I can
  7. RN> figure this out :-)))
  8. }
  9.  
  10. Unit Font;
  11.  
  12. {     AX  =  $1110      (ah = $11, al = $10)
  13.           BH  =  bytes per character
  14.           BL  =  block to load to.  (use 0)
  15.           CX  =  number of character defined by table
  16.           DX  =  starting character value
  17.           ES  =  segment of the table (use Seg())
  18.           BP  =  offset of the table (use Ofs())                    }
  19. Interface
  20.  
  21. Procedure DoFont(Fname: String);
  22.  
  23. Implementation
  24.  
  25. Uses DOS;
  26. Type FontArray= Array[1..$1000] of Char;
  27.  
  28.     FontFile= Record
  29.        Gfont_POINTS: Byte;
  30.               Gfont: FontArray;
  31.                 End; {of record}
  32. VAR FonF: File;
  33.     Tfont: FontFile;
  34.     ESr,BPr: Word;
  35. {---------------------------------------------------------------------------}
  36. Procedure DoFont(Fname: String);
  37.  
  38. VAR R: Registers;
  39.  
  40. Begin;
  41. Assign (FonF,Fname+'.FON');
  42. Reset (FonF, SizeOf(FontFile));
  43. BlockRead (FonF, Tfont, 1);
  44. Close (FonF);
  45. ESr:= Seg(Tfont.Gfont);
  46. BPr:= Ofs(Tfont.Gfont);
  47. r.ax := $1110;
  48. r.bh := Tfont.Gfont_Points;            (* bytes per character *)
  49. r.bl := 0;                             (* load to block 0 *)
  50. r.cx := 256;                           (* 256 characters *)
  51. r.dx := 0;                             (* start with character 0 *)
  52. r.es := Seg(Tfont.Gfont);              (* segment of table *)
  53. r.bp := Ofs(Tfont.Gfont);              (* offset of the table *)
  54. intr($10, r);
  55. End; {of procedure}
  56.  
  57. End.
  58.